var apis = require('../../config/api/index')
var HttpRequestUtil = require('../../config/request/index') // 引入request文件
var login = {}

/**
 *
 * @param req
 * @param res
 * @param next
 */
login.getKeyContrall = function (req, res, next) {
    var url = apis.getDemo
    HttpRequestUtil.getReq(url, function (result) {
        req.body.newObject = result.data
        return next()
    })
}

login.getPostInfo = function(req, res, next) {
    var param = {
        url: apis.getPostInfo
    }
    HttpRequestUtil.postJson(param, function (result) {
        console.log(result, 'reulsut');
        res.json(result.data);
        return next();
    })
}

exports.login = login

